import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/element.js'

// 配置全局axios

// 导入axios模块
import axios from 'axios'
// 把axios挂载到vue原型对象上
Vue.prototype.$ajax = axios
// 配置baseAPI地址
axios.defaults.baseURL = 'http://127.0.0.1:8888/api/private/v1/'
// axios预处理

axios.interceptors.request.use((config) => {
  // config里面存放着axios的配置项
  config.headers.Authorization = window.sessionStorage.getItem('token')
  console.log(config.headers)
  return config
})

// 导入字体图标
import './assets/fonts/iconfont.css'

// 全局样式
import './assets/global.css'

Vue.config.productionTip = false

new Vue({
  router,
  render: (h) => h(App),
}).$mount('#app')
